import React from "react";
import { useTextChatState } from "../models/textChatState";
import TextChatDialog from "../../../components/textChatDialog/TextChatDialog";

const TextChatPage = (props) => {

    const {
        loading, textChatMessages, setTextChatMessages, setSelectedDocument, selectedPattern, setSelectedPattern,
        focusBlurFlag, setFocusBlurFlag, completeStatus, onSendChat
    } = useTextChatState();

    const textChatDialogProps = {
        loading,
        libraryVisible: false,
        pageSource: "llm",
        textChatMessages,
        setTextChatMessages,
        selectedPattern,
        focusBlurFlag,
        completeStatus,
        patternOptions: null,
        documentOptions: null,
        selectDocument: setSelectedDocument,
        selectPattern: setSelectedPattern,
        focusBlurTextArea: setFocusBlurFlag,
        onSendChat: (values, query) => onSendChat(values, query)
    }

    return (
        <div style={{ width: "100%", height: "100%" }}>
            <TextChatDialog { ...textChatDialogProps } />
        </div>
    );
}

export default TextChatPage;
